import java.util.Arrays;

public class Main {

    public static void main(String[] args) {
        Solution solution=new Solution();
        int[] a=new int[]{1,2,3,4,5,6,7};
        solution.rotate(a,3);
    }
}
  //旋转数组
class Solution {
    public void rotate(int[] nums, int k) {
            int[] l=new int[nums.length];
            int a=k % nums.length;
            for (int i = 0; i < nums.length; i++) {
                if (i+a<=(nums.length-1)){
                    l[i+a]=nums[i];
                }
                else l[i+a- nums.length]=nums[i];
        }
        System.out.println(Arrays.toString(l));
    }
}


   //消失的数字
class Solution1 {
    public String toString(int[] a) {
        return Arrays.toString(a);
    }
    public int missingNumber(int[] nums) {
        Arrays.sort(nums);
        for(int i=0;i<nums.length;i++){
            if(nums[i]!=i)
                return i;
        }return nums.length;

    }
}